package com.example.demo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.util.Date;
import java.util.Objects;

/**
 * 功能描述：
 *
 * @Author: Zhanghf
 * @Date: 2021/12/11 14:50
 */
public class Tag {
    @TableId(type = IdType.AUTO)
    private Integer id;

    public Tag(Integer userid, Integer bookid, Integer chapterid, Date date) {
        this.userid = userid;
        this.bookid = bookid;
        this.chapterid = chapterid;
        this.date = date;
    }

    private Integer userid;
    private Integer bookid;
    private Integer chapterid;
    private Date date;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Tag)) return false;
        Tag tag = (Tag) o;
        return Objects.equals(userid, tag.userid) &&
                Objects.equals(bookid, tag.bookid) &&
                Objects.equals(chapterid, tag.chapterid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userid, bookid, chapterid);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public Integer getBookid() {
        return bookid;
    }

    public void setBookid(Integer bookid) {
        this.bookid = bookid;
    }

    public Integer getChapterid() {
        return chapterid;
    }

    public void setChapterid(Integer chapterid) {
        this.chapterid = chapterid;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Tag() {
    }
}
